import React, { Component } from 'react';
import { View, StyleSheet, Modal } from 'react-native';
import { GLOBAL } from '../../config/global';
import { style } from '../../theme/style';

const scale = GLOBAL.SCALE;

export default class ModalPickerComponent extends Component {

	constructor(props) {
		super(props);

		let { pickerModalVisible, data, textKey, title, selectTo } = props;

		if (!pickerModalVisible) {
			pickerModalVisible = false;
		}

		if (!title) {
			title = '请选择';
		}

		if (!selectTo) {
			selectTo = 0;
		}

		this.state = {
			pickerModalVisible,
		}
	}

	render () {

		return (
			<Modal animationType={"fade"}
				transparent={true}
				visible={this.state.pickerModalVisible}  >
				<View style={styles.containerModal}>
				</View>
			</Modal>
		);

	}
}

const styles = StyleSheet.create({
	containerModal: {
		width: 375 * scale,
		height: GLOBAL.SCREEN_HEIGHT,
		backgroundColor: 'rgba(0, 0, 0, .3)',
		justifyContent: 'flex-end'
	},
	pickerHead: {
		flexDirection: 'row',
		justifyContent: 'space-around',
		height: 40 * scale,
		width: 375 * scale,
	},
	pickerHeadText: {
		fontSize: 16 * scale,
		color: style.color.themeColor,
		paddingTop: 16 * scale,
	},
	pickerCell: {
		backgroundColor: '#fff',
		width: 375 * scale,
		height: '45%',
	},
	pickerView: {
		flex: 1,
		flexDirection: 'row',
		alignItems: 'center',
	},
})